package com.jiazhong.basic.pack0517;

import com.jiazhong.basic.pack0517.bean.Emp;
import com.jiazhong.basic.pack0517.dao.EmpDAO;

import java.util.Scanner;

public class App {
    public static void main(String[] args) {
        // 模拟以下页面的操作
        Scanner scan = new Scanner(System.in);
        System.out.print("请输入姓名：");
        String ename = scan.next();
        System.out.print("请输入职业：");
        String job = scan.next();
        System.out.print("请输入上司ID：");
        int mgr = scan.nextInt();
        System.out.print("请输入工资：");
        double sal = scan.nextDouble();
        System.out.print("请输入奖金：");
        double comm = scan.nextDouble();
        System.out.print("请输入部门ID：");
        int deptNo = scan.nextInt();
        EmpDAO empDAO = new EmpDAO();
        Emp emp = new Emp();
        emp.setComm(comm);
        emp.setJob(job);
        emp.setMgr(mgr);
        emp.setSal(sal);
        emp.setEname(ename);
        emp.setDeptNo(deptNo);
        int row = empDAO.add(emp);
        System.out.println(row);
    }
}
